18. Video: JOINing Subqueries

JOINing Subqueries to Improve Performance

Code along with Derek in the SQL Explorer below this next video. At the end, run each of the subqueries independently to get a better understanding of how they work.

Joining Subqueries

Code

If you need a code on the https://github.com/udacity.

Expert Tip

If you’d like to understand this a little better, you can do some extra research on cartesian products. It’s also worth noting that the FULL JOIN and COUNT above actually runs pretty fast—it’s the COUNT(DISTINCT) that takes forever.